let str = '123456789';
let buff = new Buffer(str); // 默认用 utf-8 编码格式解释字符串
let base64 = buff.toString('base64');
console.log('"' + str + '" converted to Base64 is "' + base64 + '"');
